/*
 * NetworkNetwork.cpp
 *
 *  Created on: Jun 3, 2010
 *      Author: sdaniele
 */

#include "NetworkProxy.h"
#include "NetworkNetwork.h"


namespace noti {

#define curr_name(type)\
	(#type"_"+intToStr(name_cnt++))

NetworkNetwork::NetworkNetwork(bool is_thread)
	:m_is_thread(is_thread)
{}

NetworkNetwork::~NetworkNetwork() {}

NetworkProxy& NetworkNetwork::event_network(size_t n){
	static unsigned long name_cnt = 0;

	for(size_t i=0; i<n; i++)
		m_ens.push_back( new EventNetwork( curr_name(en), m_is_thread ) );

	NetworkProxy* tmp = new NetworkProxy(this);
	m_proxies.push_back(tmp);
	return *tmp;
}

}
